# Contributor: Anjandev Momi <anjan@momi.ca>
# Maintainer: Anjandev Momi <anjan@momi.ca>
pkgname=editorconfig-checker
pkgver=2.5.0
pkgrel=0
pkgdesc="A tool to verify that your files are in harmony with your .editorconfig"
url="https://editorconfig-checker.github.io/"
license="MIT"
arch="all"
makedepends="go"
options="chmod-clean"
builddir="$srcdir/github.com/editorconfig-checker/$pkgname"
source="$pkgname-$pkgver.tar.gz::https://github.com/editorconfig-checker/editorconfig-checker/archive/$pkgver.tar.gz"

prepare() {
	mkdir -p "$srcdir/github.com/editorconfig-checker"
	mv "$srcdir/$pkgname-$pkgver" "$srcdir/github.com/editorconfig-checker/editorconfig-checker"
	default_prepare
}

check() {
	sed -i 's/-race//' Makefile # -buildmode=pie not supported when -race is enabled
	GOPATH="$srcdir" make test
}

build() {
	GOPATH="$srcdir" make build
}

package() {
	install -Dm755 "$builddir/bin/ec" -t "$pkgdir/usr/bin"
}

sha512sums="
c9f58495e4e0f583d38daacd121b80429d916394b390c59a70027ca58b8d3178d6edbe09a3d71c176e243cf473de0ee95b432ccc6ec93178e071e814791beaea  editorconfig-checker-2.5.0.tar.gz
"
